package net.xinqushi;
import com.alibaba.druid.sql.visitor.functions.Char;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class , args);
    }

    @RequestMapping("/")
    public String hello(){
        ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
        for(;currentLoader != null ; currentLoader = currentLoader.getParent()){
            System.out.println(currentLoader);
        }
        return "hello world";
        /*Springboot类加载器
        TomcatEmbeddedWebappClassLoader
          context: ROOT
          delegate: true
        ----------> Parent Classloader:
        sun.misc.Launcher$AppClassLoader@18b4aac2

        sun.misc.Launcher$AppClassLoader@18b4aac2
        sun.misc.Launcher$ExtClassLoader@68f7aae2
         */
    }
}
